<?php
/**
 * Created by PhpStorm.
 * User: asus
 * Date: 2018/2/28
 * Time: 15:34
 */

namespace app\index\controller;
use app\index\controller\BaseController;
class Mobile extends baseController
{
    public function sendsms(){
        $reqData['phone'] = $this->request->post('phone');
        $reqData['type'] = $this->request->post('type');
        // 表单验证
        $validata = $this->validate($reqData,'app\index\validate\Mobile');
        if (true !== $validata) {
            // 验证失败 输出错误信息
            $this->result['status'] = -1;
            $this->result['msg'] = $validata;
            return json_encode($this->result);
        }
        
        $result = $this->getBusiness('Mobile')->sendSms($reqData);
        return json_encode($result);
    }
}